package nku.csc364;

import java.util.Random;

//Canidate Class
//Implements comparable to compare objects


public class Candidate implements Comparable{
	private int serial;
	private String string;
	
	public Candidate(){
		Random randomGenerator = new Random();
		serial = randomGenerator.nextInt(10000);		
		
	}
	
	public int getSerial(){
		return serial;
	}
	
	public void setSerial(int value){
		serial = value;
	}
	
	public void setString(String value){
		string = value;
	}
	
	public String getString(){
		return string;
	}
	
	public int compareTo(Object canidate){
		int output;
		int compare = ((Candidate)canidate).getSerial();
		if (serial < compare ){
			output = -1;
		}
		else if (serial > compare){
			output = 1;
		}
		else{
			output = 0;	
		}
		return output;
		
	}
	
	//Extra to string to check for sortedness
	public String toString(){
		System.out.println(serial + "\n");
		return null;
	}

	
}